#!/bin/csh -f

#****************************************************************************
#***
#***   Copyright (c) 1997 by Max Moroz and ABKGroup, UCLA VLSI CAD Laboratory,
#***    UCLA Computer Science Department, Los Angeles, CA 90095-1596 USA, 
#***    and by the Regents of the University of California.    
#***    All rights reserved.   
#***
#***    No portion of this package may be used, copied, or transmitted for
#***    any purpose, including any research or commercial purpose,
#***    without the express written consent of Professor Andrew B. Kahng,
#***    UCLA Computer Science Department, 3713 Boelter Hall, Los Angeles,
#***    CA 90095-1596 USA.   Any copy made of this file must include this
#***    notice.    ABKGroup and the Regents of the University of California
#***    retain title to all copies of this file and/or its compiled
#***    derivatives.
#***
#*****************************************************************************/

set DIFF=/usr/bin/diff
set WC=/usr/bin/wc
set PROG=GenHierTest 

/bin/rm -f seeds.{in,out} *.diff >& /dev/null

echo "------------  Running test 0 ..." > new.out
echo -n Running test 0 ...
${PROG}0.exe  -f TESTS/size99.hcl >> new.out
cat newHCL.hcl >> new.out
echo Ok

echo "------------  Running test 0 ..." >> new.out
echo -n Running test 0 ...
${PROG}0.exe  -f TESTS/size99.hcl >> new.out
cat newHCL.hcl >> new.out
echo Ok

echo "------------  Running test 1 ..." >> new.out
echo -n Running test 1 ...
${PROG}1.exe  >>& new.out
cat test1.hcl >> new.out
echo Ok

echo "------------  Running test 2 ..." >> new.out
echo -n Running test 2 ...
${PROG}2.exe < TESTS/words2.txt >>& new.out
cat test2.hcl >> new.out
echo Ok

echo "------------  Running test 4a..." >> new.out
echo -n Running test 4 ...
${PROG}4.exe < TESTS/words4.txt >>& new.out
cat test4a.hcl >> new.out
echo "------------  Running test 4b..." >> new.out
cat test4b.hcl >> new.out
echo Ok


egrep -vi "(Created|sec|User|Platform|Memory us)" new.out > newout.notime
egrep -vi "(Created|sec|User|Platform|Memory us)" expected.out > expectedout.notime
$DIFF newout.notime expectedout.notime > diffs.notime

echo " "
echo Differences from precomputed results
echo "  lines:  words:  bytes:    error log:"
$WC diffs.notime

